<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>正则测试--边界符</title>
	<script type="text/javascript">
		var reg1 = /\bscript\b/;
		var str ="s script s";
		document.write(reg1.test(str));
		document.write("<br />");
		var reg2=/javascript?(?=\:)/;
		var str2="javascript:great";
		var str3="javascript is great";
		document.write(reg2.test(str2));
		document.write("<br />");
		document.write(reg2.test(str3));

		var reg3 =/java(?!script)\w*/;
		var str4="javascript is nice";
		var str5="javascrip is nice";
		document.write("<br />");
		document.write(reg3.test(str4));
		document.write("<br />");
		document.write(reg3.test(str5));
	</script>
</head>
<body>
	
</body>
</html>